import request from '@/utils/http'
import { BaseResult, PaginationResult } from '@/types/axios'

export class AnnexService {
  // 添加附件
  static addAttach(data: any) {
    return request.post<BaseResult<PaginationResult<any>>>({
      url: '/add_goods_attachment',
      data
    })
  }
  // 附件列表
  static getAttachList(params: any) {
    return request.get<BaseResult<PaginationResult<any>>>({
      url: '/list_goods_attachment',
      params
    })
  }
  // 修改附件
  static updateAttach(data: any) {
    return request.post<BaseResult<PaginationResult<any>>>({
      url: '/update_goods_attachment',
      data
    })
  }
  // 删除附件
  static delAttach(id: number | string) {
    return request.post<BaseResult>({
      url: '/del_goods_attachment',
      data: { id }
    })
  }
  // 排序
  static updateContentSort(data: any) {
    return request.post<BaseResult>({
      url: '/update_content_sort',
      data
    })
  }
}
